﻿using System;
using RootMotion.FinalIK;
using UnityEngine;

namespace RootMotion.Demos
{
	// Token: 0x0200009E RID: 158
	public class FBBIKSettings : MonoBehaviour
	{
		// Token: 0x06000558 RID: 1368 RVA: 0x00034B3C File Offset: 0x00032D3C
		public void UpdateSettings()
		{
			if (this.ik == null)
			{
				return;
			}
			this.leftArm.Apply(FullBodyBipedChain.LeftArm, this.ik.solver);
			this.rightArm.Apply(FullBodyBipedChain.RightArm, this.ik.solver);
			this.leftLeg.Apply(FullBodyBipedChain.LeftLeg, this.ik.solver);
			this.rightLeg.Apply(FullBodyBipedChain.RightLeg, this.ik.solver);
			this.ik.solver.chain[0].pin = this.rootPin;
			this.ik.solver.bodyEffector.effectChildNodes = this.bodyEffectChildNodes;
		}

		// Token: 0x06000559 RID: 1369 RVA: 0x0000560B File Offset: 0x0000380B
		public void Start()
		{
			Debug.Log("FBBIKSettings is deprecated, you can now edit all the settings from the custom inspector of the FullBodyBipedIK component.");
			this.UpdateSettings();
			if (this.disableAfterStart)
			{
				base.enabled = false;
			}
		}

		// Token: 0x0600055A RID: 1370 RVA: 0x0000562F File Offset: 0x0000382F
		public void Update()
		{
			this.UpdateSettings();
		}

		// Token: 0x04000435 RID: 1077
		public FullBodyBipedIK ik;

		// Token: 0x04000436 RID: 1078
		public bool disableAfterStart;

		// Token: 0x04000437 RID: 1079
		public FBBIKSettings.Limb leftArm;

		// Token: 0x04000438 RID: 1080
		public FBBIKSettings.Limb rightArm;

		// Token: 0x04000439 RID: 1081
		public FBBIKSettings.Limb leftLeg;

		// Token: 0x0400043A RID: 1082
		public FBBIKSettings.Limb rightLeg;

		// Token: 0x0400043B RID: 1083
		public float rootPin;

		// Token: 0x0400043C RID: 1084
		public bool bodyEffectChildNodes = true;

		// Token: 0x0200009F RID: 159
		[Serializable]
		public class Limb
		{
			// Token: 0x0600055C RID: 1372 RVA: 0x0000564A File Offset: 0x0000384A
			public void Apply(FullBodyBipedChain chain, IKSolverFullBodyBiped solver)
			{
				solver.GetChain(chain).reachSmoothing = this.reachSmoothing;
				solver.GetEndEffector(chain).maintainRelativePositionWeight = this.maintainRelativePositionWeight;
				solver.GetLimbMapping(chain).weight = this.mappingWeight;
			}

			// Token: 0x0400043D RID: 1085
			public FBIKChain.Smoothing reachSmoothing;

			// Token: 0x0400043E RID: 1086
			public float maintainRelativePositionWeight;

			// Token: 0x0400043F RID: 1087
			public float mappingWeight = 1f;
		}
	}
}
